using System;
using System.Configuration;
using System.Web;
using Logic.SocialNetworks;
using Social.FlickrApi;

namespace SocialNetworks.Config
{
	public class FlickrConfig : IFlickrConfig
	{
		public string AppKey
		{
			get { return ConfigurationManager.AppSettings["flickr_appKey"]; }
		}

		public string AppSecret
		{
			get { return ConfigurationManager.AppSettings["flickr_appSecret"]; }
		}

		public string UserToken
		{
			get
			{
				var cookie = HttpContext.Current.Request.Cookies["flickr_token"];
				return cookie == null ? null : cookie.Value;
			}
			set { HttpContext.Current.Response.Cookies.Add(new HttpCookie("flickr_token", value) { Expires = DateTime.Now.AddDays(1) }); }
		}
	}
}